package org.sixtythousand.joker.netty;

import org.sixtythousand.joker.AbstractConnectionFactory;
import org.sixtythousand.joker.Connection;
import org.sixtythousand.joker.JChannel;
import org.sixtythousand.joker.handler.Handler;
import org.sixtythousand.joker.http.HttpChannel;

import java.util.List;
import java.util.concurrent.Executor;

/**
 * @author zhoulk
 * @date 2023/10/11 16:25
 * @desc
 */
public class NettyConnectionFactory extends AbstractConnectionFactory {
    @Override
    public Connection newConnection(JChannel channel, Handler handler, Executor executor) {
        return new NettyConnection((HttpChannel) channel,  handler, executor);
    }

    @Override
    public List<String> getProtocols() {
        return List.of("http");
    }
}
